<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

require_once("../basicInfo/db.php");

class Feedback {
    private $reviewId;
    private $qId;
    private $reviewer;
    private $comment;
    private $rating;


    public function getReviewId() {
        return $this->reviewId;
    }

    public function getQuestionId() {
        return $this->qId;
    }

    public function getReviewer() {
        return $this->reviewer;
    }

    public function getComment() {
        return $this->comment;
    }

    public function getRating() {
        return $this->rating;
    }

    public function setReviewId($reviewID) {
        $this->reviewId = $reviewID;
    }

    public function setQuestionId($qid) {
        $this->qId = $qid;
    }

    public function setReviewer($rev) {
        $this->reviewer = $rev;
    }

    public function setComment($comm) {
        $this->comment = $comm;
    }

    public function setRating($rate) {
        $this->rating = $rate;
    }




}
    /**
 * controller class for questionss.
 *
 * @todo methods need implementation
 */
class FeedbackController {
/* MHS: format todo to conform to phpdocu standard
 * MHS: todo should indicate what needs to be done
 * MHS: basic planned functionality should be included in todo header
 */
    /**
     * Constructor for question controller
     * @todo to be written
     * @return
     */
    public function __construct() {

    }

    /**
     * Returns an instantiation of a new question object.
     * @return Question instatiation of a question object
     */
    public static function getFeedback() {
        return new Feedback();
    }

    public static function getAllFeedbacks($qid) {
		$allFeedbackArr = getAllFeedbacks($qid);
        $allFeedbackObjArr = array();

        for ($i = 0; $i < sizeof($allFeedbackArr); $i++) {
            $fbObj = FeedbackController::getFeedback();

            $fbObj->setComment($allFeedbackArr[$i]['comment']);
			$fbObj->setReviewer($allFeedbackArr[$i]['reviewer']);
            $fbObj->setRating($allFeedbackArr[$i]['rating']);


            array_push($allFeedbackObjArr, $fbObj);
        }

        return $allFeedbackObjArr;
	}

	public static function create_feedback ($qid,$reviewer,$comment,$rating){
	         create_feedback ($qid,$reviewer,$comment,$rating);
    }
}



?>
